<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="/system/include/taglib.jsp"%>
<html>
<head>
<base href="${pageScope.basePath }">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中山市美斯特实业有限公司</title>
<link type="text/css" rel="stylesheet" href="system/css/style.css" />
<script type="text/javascript" language="javascript" src="system/js/public.js"></script>
<script type="text/javascript" src="system/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="system/js/validate.js"></script>
<script type="text/javascript">
		//验证按钮名是否为空
		$(document).ready(function(){		
				validate_Effect("#menuName","[菜单名不能为空！]");
				validateNumber_Effect("#menuSort","排序非法，要求是正整数!");	
				validate_Effect("#actionKey","[操作键不能为空！]");		
				var old_actionKey=$("#actionKey").val();
				$("#actionKey").change(function(){
				  		var actionKey=$("#actionKey").val();
				  		if(actionKey==old_actionKey) return false;
				  		ajaxRequest_validate("#actionKey","system/ajax/menu.do?method=validate",{"actionKey":actionKey});
				});		
	
			});	
			
function checkForm(){	
	var menuNameIsNull=validateValueIsNull("#menuName");
	if(menuNameIsNull){
		return false;
	}
	var menuSortIsRight=validateNumberIsRight("#menuSort");
	if(!menuSortIsRight){
		return false;
	}
	var actionKeyIsNull=validateValueIsNull("#actionKey");
	if(actionKeyIsNull){
		return false;
	}	
	else{
		return true;
	}
}
</script>

</head>
<body>
<div class="main">
	<div class="position">当前位置: <a href="sysadm/desktop.jsp">桌 面</a> → 添加菜单</div>
	<div class="mainbody">
		<div class="operate_info">操作说明：带 * 号必填</div>
		<div class="table">
		<form action="system/config/menu_manage_modify.do" method="post" onsubmit="return checkForm()">
			<mytag:View table="com.zhongkai.model.config.Menu" id="${param.menu_id }" name="update_menu"></mytag:View>
			<input type="hidden" name="menuId" value="${update_menu.menuId}"/>
			<table width="100%" border="0" cellpadding="1" cellspacing="1" class="table_form">
					<tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this)">
						<td align="right">菜单名称：</td>
						<td><input name="menuName" id="menuName" value="${update_menu.menuName}"/>　*必填 </td>
					</tr>
					<tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this)">
						<td align="right">排序：</td>
						<td><input name="update_menuSort" value="${update_menu.menuSort}" id="menuSort" size="5" />　*必填 默认 0 </td>
					</tr>
					<tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this)">
						<td align="right">链接地址：</td>
						<td><input name="menuUrl" value="${update_menu.menuUrl}"/>　非必填 例如：addform.jsp </td>
					</tr>
					<tr onMouseOver="mouseOver(this)" onMouseOut="mouseOut(this)">
						<td align="right">操作键：</td>
						<td><input name="actionKey" id="actionKey" value="${update_menu.actionKey}"/>　*必填 例如：adduser </td>
					</tr>
					
					<tr>
						<td colspan="2" class="form_button" style="padding-top:10px;">
							<input type="submit" value="更新" />
							<input type="button" value="返回" onClick="location.href='${pageScope.basePath }system/config/menu_manage_list.jsp'" />
						</td>
					</tr>
			</table>
			</form>
		</div>
	</div>
</div>
</body>
</html>
